﻿using System;
using System.Web;
using Microsoft.SharePoint;
using TemplateLibraryConnector.UI;

namespace TemplateLibraryConnector
{
    public class LastUsed : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            
            var userName = SPContext.Current.Web.CurrentUser.LoginName;
            var sitecollection = SPContext.Current.Site.ID;
            var fileNameUrl = context.Request.Params["Name"];

            TemplateHubController.UpdateLastUsedProperty(fileNameUrl, userName, sitecollection);
        }

        public bool IsReusable
        {
            get { throw new NotImplementedException(); }
        }
    }
}